<%@ include file="/WEB-INF/views/framework/global.jsp"%>
<%-- <%@ taglib prefix="form" uri="http://www.springside.org.cn/tags/form" %> --%>
<%@ taglib prefix="form" uri="/WEB-INF/tld/springside-form.tld"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>创建账户</title>
	<link rel="stylesheet" href="${path}/static/stylesheets/default_theme/framework.css" type="text/css">
</head>
<body class="kk">
	<ul class="nav nav-tabs g_navbar">
		<li><a href="${reqRoot}">创建账户</a></li>
		<li class="active"><a href="#">添加账户</a></li>
	</ul>
	<div class="framework_container">
		<div class="row">
			<div class="col-lg-2"></div>
			<div class="col-lg-8">
				<form:form modelAttribute="account" class="form-horizontal" id="my_form" role="form" action="${reqRoot}/add" method="post">
					<div class="form-group">
						<label class="col-lg-3 control-label" for="exampleInputEmail1">教师账号：</label>
						<div class="col-lg-9">
							<input type="text" class="form-control" id="name" name="name"
								placeholder="只允许字母、数字、中横线、下划线">
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-3 control-label" for="exampleInputPassword1">密码：</label>
						<div class="col-lg-9">
							<input type="password" class="form-control" id="password"
								name="password" placeholder="密码">
						</div>
					</div>
		<!-- 			<div class="form-group">
						<label class="col-lg-3 control-label" for="exampleInputPassword1">密码确认：</label>
						<div class="col-lg-9">
							<input type="password" class="form-control" id="repeatPassword"
								name="repeatPassword" placeholder="请再次输入密码">
						</div>
					</div>  -->
					<div class="form-group">
						<label class="col-lg-3 control-label" for="exampleInputEmail1">教师姓名：</label>
						<div class="col-lg-9">
							<input type="text" class="form-control" id="exampleInputEmail1"
								name="username" value=${user.name}>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-3 control-label" for="unit">组织机构</label>
						<div class="col-lg-9 rel">
							<div class="popover fade bottom in" id="element"
								style="display: block; left: 0; top: 36px; width: 100%; max-width: 1000px; display: none;">
								<div class="arrow"></div>
								<h3 class="popover-title">组织机构选择</h3>
								<div class="popover-content">
									<ul id="appTree" class="ztree"></ul>
								</div>
							</div>
							<input class="form-control" id="unit" name="unit" readonly="readonly" value="${user.account.unit.name}" data-value="${user.account.unit.id}">
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-3 control-label" for="role"><form:label path="roleList">角色</form:label></label>
						<div class="col-lg-9 rel">
							<div class="fix rolebox">
								<form:bscheckboxes path="roleList" items="${allRoles}" itemLabel="label" itemValue="id" />
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-3 control-label" for="exampleInputEmail1">手机：</label>
						<div class="col-lg-9">
							<input type="text" class="form-control" id="exampleInputEmail1"
								name="phone" value=${user.phone}>
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-3 control-label" for="exampleInputEmail1">电子邮件：</label>
						<div class="col-lg-9">
							<input type="text" class="form-control" id="exampleInputEmail1"
								name="email" value=${user.email}>
						</div>
					</div>
					<div class="form-group">
						<div class="col-lg-3"></div>
						<div class="col-lg-9">
							<button type="submit" class="btn btn-success" id="submit">确定</button>
						</div>
					</div>
				</form:form>
			</div>
			<div class="col-lg-2"></div>
		</div><!-- /row -->
		<script src="${cmpRoot}/account_add.js"></script>
		<script>
			// 用于调整iframe高度自适应
			(function ($) {
				window.passHeight = function() {
					setTimeout(function () {
						var unitTop = $('#unit').offset().top
							, elementHeight = $('#element').height()
							, absHeight = unitTop + elementHeight + 50;
						var constr = $('.kk')
							, bh = 0;
						if (constr.outerHeight(true) < absHeight) {
							bh = absHeight;
						} else {
							bh = constr.outerHeight(true);
						}
						window.top.location.hash = "#height=" + bh;
					}, 300);
				};
				passHeight();
			}) (jQuery);
		</script>
</body>
</html>
